from tkinter import *
from tkinter import messagebox
import tkinter.messagebox
class login(Frame):
    def __init__(self, master) -> None:
        super().__init__(master=master)#frame.__init__(root)\frame(root)
        self.create()
    def create(self):
        #添加标签
        self.Bt=Button(self,text="实验四画图",bg="gold",width=15,font="宋体,20")
        self.Bt.grid(row=3,column=2)
        self.Bt.bind("<Button-1>",self.btclicks)
        self.btr=Button(self,text="组队作业",bg="gold",width=15,font="宋体,20")
        self.btr.grid(row=4,column=2)
        self.btr.bind("<Button-1>",self.clickreg)
        self.stu=Button(self,text="学生信息管理系统之录取删除",bg="gold",width=15,font="宋体,20")
        self.stu.grid(row=5,column=2)
        self.stu.bind("<Button-1>",self.click)

    def btclicks(self,event):
        self.master.destroy()#点击注销之前的窗口master,局部
       
        #导入文本
        #进入画图模式
        import GUI4 
        """root=Tk()
        root.geometry("800x600")
        application=GUI4.DrawP(root) 
        application.pack()
        root.mainloop()"""

    def clickreg(self,event):
        self.master.destroy()
        #导入文本
        import draw
    def click(self,event):
        self.master.destroy()
        #导入文本
        import students
        if __name__=='__main__':
            students.main()

root=Tk()
root.title("登入成功——主菜单")
root.geometry("400x400+200+200")
app=login(root)
app.grid(row=1,column=1)
root.mainloop()




"""//输入要读取的文件名 
void WritetoText(Student room[],int n)              

{
int i=0;

FILE *fp;          

char filename[100];                

     printf("\t\t循环写入数据\n");    

     printf("\t\t输入文件名:");

     scanf("\t\t%s",&filename);

     if((fp=fopen(filename,"w"))==NULL)            

     {
      printf("\t\t无法打开该文件\n");

      system("pause");

      return;

     }

     fprintf(fp,"%d\n",n);            

     while(i<n)

     {
      fprintf(fp,"%-10s%-10s%-10s%-10s\n",room[i].roomnum,room[i].bednum,room[i].num,room[i].name);

      i++;

     }

     fclose(fp);          

     printf("写入成功!\n");          

}


 				 case 9:

                 printf("\t\t循环写入数据\n");

                 WritetoText(room1,n);                  

                 printf("\t\t");

                 system("pause");

                 break;"""